package cn.ichiva.game.poker.ddz.cardType.impl;

import cn.ichiva.game.poker.ddz.Card;
import cn.ichiva.game.poker.ddz.ICardType;

/**
 * @Description 三带一
 * @auther Chiva 874460517@qq.com
 * @create 2020-01-13 16:04
 */
public class Type3And1Card extends CardType {

    int num=4;

    public Type3And1Card(Card[] cards) {
        super(cards);
    }

    @Override
    public boolean cardTypeCheck() {
        if(num == cards.length){
           return (cards[0].getIndex() == cards[1].getIndex() && cards[0].getIndex() == cards[2].getIndex() && cards[0].getIndex() != cards[3].getIndex() )
                   || (cards[3].getIndex() == cards[1].getIndex() && cards[3].getIndex() == cards[2].getIndex() && cards[3].getIndex() != cards[0].getIndex());
        }
        return  false;
    }
}
